import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
import Details from '../views/Details.vue'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import Category from '../views/Category.vue'
import Shopcar from '../views/Shopcar.vue'
import Searchlist from '../views/Searchlist.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/searchlist',
    name: 'searchlist',
    component:Searchlist
  },
  {
    path: '/shopcar',
    name: 'shopcar',
    component:Shopcar
  },
  {
    path: '/category',
    name: 'category',
    component:Category
  },
   {
    path: '/',
    name: 'index',
    component:Index
  },
  {
    path: '/details/:lid',
    name: 'details',
    component:Details,
    props:true
  },
  {
    path: '/login',
    name: 'login',
    component:Login
  },
  {
    path: '/register',
    name: 'register',
    component:Register
  }
  // {
  //   path: '',
  //   name: '',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //  // component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  routes
})

export default router
